{extend name="$base" /}
{block name="resources"}
<style>
    .count-table .title{
        font-weight:bold;
        margin-bottom:10px;
    }
    .count-table span{
        display:inline-block;
        margin-right: 10px;
    }
    .table-class{border-top: 1px solid #E1E6F0}
    .text-color {color: #F88D00}
</style>
{/block}
{block name="right_tab"}{/block}
{block name="main"}
<table class="table-class count-table" >
    <tbody>
    <tr>
        <td width="1%"></td>
        <td>
            <div class="title">产品信息</div>
            <span>产品名称：<span class="text-color">{$goods_info.goods_name}</span></span>
            <span>所属品类：<span class="text-color">{$goods_info.category_name}</span></span>
            <span>红旗手数量：<span class="text-color">{$goods_info.middle_num}</span></span>
            <input type="hidden" id="goods_id" value="{$goods_id}"/>
        </td>
    </tr>
    </tbody>
</table>
<div class="mod-table">
    <div class="mod-table-head">
        <div class="con style0list">
            <table class="table-class">
                <colgroup>
                    <col style="width: 10%;">
                    <col style="width: 30%;">
                    <col style="width: 46%;">
                    <col style="width: 14%;">
                </colgroup>
                <thead>
                <tr>
                    <th>头像</th>
                    <th>账号</th>
                    <th>下级红旗手数量</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody></tbody>
            </table>
        </div>
    </div>
</div>
{/block}
{block name="script"}
{include file="admin/pageCommon" /}
<script type="text/javascript">
    //加载数据
    function LoadingInfo(page_index) {
        var goods_id = $("#goods_id").val();
        $.ajax({
            type : "post",
            url : "{:__URL('AGENT_MAIN/stat/promoter')}",
            data : {
                "page_index" : page_index,
                "page_size" : $("#showNumber").val(),
                "goods_id" : goods_id
            },
            success : function(data) {
                $("#page_count").val(data["page_count"]);
                $("#pageNumber a").remove();
                var html = '';
                if (data["data"].length > 0) {
                    for (var i = 0; i < data["data"].length; i++) {
                        html += '<tr align="center">';
                        html += '<td>';
                        if(data["data"][i]["user_headimg"] ==""){
                            html += '<img src="{:__IMG($default_headimg)}" class="head-portrait"/>';
                        }else{
                            html += '<img src="'+__IMG(data["data"][i]["user_headimg"])+'" class="head-portrait"/>';
                        }
                        html += '</td>';
                        html += '<td>' + data["data"][i]["user_name"] + '</td>';
                        html += '<td>' + data["data"][i]["middle_num"] + '</td>';
                        html += '<td>';
                        html +=	'</td> ';
                        html += '</tr>';
                    }
                } else {
                    html += '<tr align="center"><td colspan="4">暂无符合条件的数据记录</td></tr>';
                }

                $(".style0list tbody").html(html);
                initPageData(data["page_count"],data['data'].length,data['total_count']);
                $("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
            }
        });
    }
    //全选
    function CheckAll(event){
        var checked = event.checked;
        $(".style0list tbody input[type = 'checkbox']").prop("checked",checked);
    }

</script>
{/block}